<?php
class Public_Comment_DeleteSuccessView extends BlogPublicBaseView
{
    public function executeHtml(AgaviRequestDataHolder $rd)
    {
        $return_url = $rd->getParameter('return_url');
        if ($return_url !== FALSE && $return_url !== NULL) {
            $this->getResponse()->setRedirect($return_url);
        } else {
            // redirect back to the post
            /* @var $posts_model Public_PostsModel */
            $posts_model = $this->getContext()->getModel('Posts', 'Public');
            $comment = $this->getAttribute('comment');
            $route_elements = $posts_model->getPostCoordinates($comment->Post);
            $this->setRoutingRedirect('post.view', $route_elements);
        }
    }
}
?>
